﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DtuService
{
    public class WebMessageFactory
    {
        public static Dictionary<uint, Type> Msgtypes = new Dictionary<uint, Type>();
        public static void RegisterMessage(Type type)
        {
            WebMessage msg = Activator.CreateInstance(type) as WebMessage;
            if (msg != null)
            {
                Msgtypes.Add(msg.CLSID, type);
            }
        }
        /*public static NetMessage CreateMessage(uint clsid)
        {
            Type type = null;
            m_msgtypes.TryGetValue(clsid, out type);
            if (type != null)
            {
                NetMessage msg = Activator.CreateInstance(type) as NetMessage;
                return msg;
            }
            else
            {
                return null;
            }
        }*/
    }
}
